import { createRouter, createWebHistory } from 'vue-router'
// import Home from '../views/Home.vue'
const routes = [
  // {
  //   path: '/',
  //   name: 'Login',
  //   component: () => import('../components/Login.vue')
  // },
  {
    path: "/",
    name: 'Login',
    component: () => import('../components/Login.vue')
  },{
    path: "/register",
    name: 'Register' ,
    component: () => import('../components/Register.vue')
  },
  {
    path:'/admin',
    name: 'admin',
    component:()=> import('../views/backAdmin'),
    children : [
      {
        path : '',
        component : () => import('../components/admin/Home')
      },
      {
        path : 'customer',
        name : 'customer',
        component : ()=>import('../components/admin/base/Customer')
      },
      {
        path : 'Home',
        name : 'AdHome',
        component : ()=>import('../components/admin/Home')
      },
      {
        path : 'drug',
        name : 'drug',
        component : ()=>import('../components/admin/drug/Drug')
      },
      {
        path : 'fodder',
        name:'fodder',
        component : ()=>import('../components/admin/fodder/Fodder')
      },
      {
        path : 'pig',
        name:'pig',
        component : ()=>import('../components/admin/pig/Pig')
      },
      {
        path : 'pigPigDeathRecords',
        name:'pigPigDeathRecords',
        component : ()=>import('../components/admin/pig/PigDeathRecords')
      },
      {
        path : 'pigDiseaseRecords',
        name:'pigDiseaseRecords',
        component : ()=>import('../components/admin/pig/PigDiseaseRecords')
      },
      {
        path : 'pigFatteningHouseDeathRecords',
        name:'pigFatteningHouseDeathRecords',
        component : ()=>import('../components/admin/pig/PigFatteningHouseDeathRecords')
      },
      {
        path : 'pigLivingSituation',
        name:'pigLivingSituation',
        component : ()=>import('../components/admin/pig/PigLivingSituation')
      },
      {
        path : 'pigNurseryDeathRecords',
        name:'pigNurseryDeathRecords',
        component : ()=>import('../components/admin/pig/PigNurseryDeathRecords')
      },
      {
        path : 'pigPurchaseRecords',
        name:'pigPurchaseRecords',
        component : ()=>import('../components/admin/pig/PigPurchaseRecords')
      },
      {
        path : 'pigSalesRecords',
        name:'pigSalesRecords',
        component : ()=>import('../components/admin/pig/PigSalesRecords')
      },
      {
        path : 'pigTransferFattening',
        name:'pigTransferFattening',
        component : ()=>import('../components/admin/pig/PigTransferFattening')
      },
      {
        path : 'pigTransferNurseryRecords',
        name:'pigTransferNurseryRecords',
        component : ()=>import('../components/admin/pig/PigTransferNurseryRecords')
      },
      {
        path : 'sow',
        name:'sow',
        component : ()=>import('../components/admin/sow/Sow')
      },
      {
        path : 'sowBirthingRecords',
        name:'sowBirthingRecords',
        component : ()=>import('../components/admin/sow/SowBirthingRecords')
      },
      {
        path : 'sowConceptionRecords',
        name:'sowConceptionRecords',
        component : ()=>import('../components/admin/sow/SowConceptionRecords')
      },
      {
        path : 'sowMatingInformation',
        name:'sowMatingInformation',
        component : ()=>import('../components/admin/sow/SowMatingInformation')
      },
      {
        path : 'sowMatingRecords',
        name:'sowMatingRecords',
        component : ()=>import('../components/admin/sow/SowMatingRecords')
      },
      {
        path : 'environmentalMonitoring',
        name:'environmentalMonitoring',
        component : ()=>import('../components/admin/monitoring/EnvironmentalMonitoring')
      },
    ]
  }
  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
